//
//  HouseTypeViewCell.m
//  WGFGlobalHouses
//
//  Created by waiguofang on 15/5/20.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "HouseTypeViewCell.h"
#import "HouseTypeCellModel.h"
#import "HouseTypeView.h"
#import "config.h"

@interface HouseTypeViewCell()



@end
@implementation HouseTypeViewCell



+(instancetype)cellWithTableView:(UITableView *)tableView WithModel1:(HouseTypeCellModel *)model1 WithModel2:(HouseTypeCellModel *)model2;
{
    static NSString *ID = @"houseTypeViewCell";
    HouseTypeViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell)
    {
        cell = [[HouseTypeViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        
        
        cell.view1 = [HouseTypeView houseTypeViewInitWithXib];
        cell.view1.frame = CGRectMake(0, 0,UIScreenWidth/2.0 -1 , 264);
        [cell addSubview:cell.view1];
        
        
        cell.view2 = [HouseTypeView houseTypeViewInitWithXib];
        cell.view2.frame = CGRectMake(UIScreenWidth/2.0, 0, UIScreenWidth/2.0, 264);
        [cell addSubview:cell.view2];
        
        
     
       
    }
     [cell.contentView setBackgroundColor:UIColorFromRGB(0xf3f3f3)];
    
    
    
    return cell;
}


-(void)layoutSubviews
{
    [super layoutSubviews];
    
    
}
-(void)setModel1:(HouseTypeCellModel *)model1 WithModel2:(HouseTypeCellModel *)model2
{
    
    [self.view1 setData:model1];
    
    
    
    if (model2 != nil)
    {
        [self.view2 setHidden:NO];
        [self.view2 setData:model2];
    }else{
        [self.view2 setHidden:YES];
    }
    
}



@end
